home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 8 / 008.d81 / dos #18 < prev    next >
Text File  |  2022-08-26  |  1KB  |  67 lines

  1.      DOS and DON'Ts  -- Part 18
  2.  
  3.         by Joel Ellis Rea
  4.  
  5.  
  6.  
  7.    This month we will discuss some ad-
  8.  
  9. vanced SEQuential file handling, in-
  10.  
  11. cluding an undocumented OPEN mode!
  12.  
  13.    The undocumented OPEN mode param-
  14.  
  15. eter is ,A for APPEND.  The ,A param-
  16.  
  17. eter tells DOS that you want to OPEN
  18.  
  19. an existing file, but that you want to
  20.  
  21. WRITE data to it, not READ data from
  22.  
  23. it.  The ,A parameter tells DOS
  24.  
  25. that all new data will be written to
  26.  
  27. the END of the file, instead of the
  28.  
  29. BEGINNING.  In other words, DOS is
  30.  
  31. told to APPEND new data to the END of
  32.  
  33. an ALREADY EXISTING file!  This saves
  34.  
  35. having to OPEN the existing file for
  36.  
  37. READ, OPENing a dummy file for WRITE,
  38.  
  39. copying every character from the READ
  40.  
  41. file to the dummy file, CLOSING the
  42.  
  43. READ file and Deleting the READ file,
  44.  
  45. before you can WRITE the new data. You
  46.  
  47. would then have to CLOSE the DUMMY
  48.  
  49. file, then RENAME the DUMMY file to
  50.  
  51. the name of the old, now deleted READ
  52.  
  53. file!  (AND you would have to hope you
  54.  
  55. had enough free space on the disk to
  56.  
  57. hold a copy of an existing file!). The
  58.  
  59. ,A(PPEND) parameter saves you that
  60.  
  61. trouble, and enables you to add new
  62.  
  63. data automatically.
  64.  
  65.  
  66. ------- Continued in Part 19 ---------
  67.